#ifndef __H_GAME_H__
#define __H_GAME_H__

#include <deque>
#include <vector>
#include <map>
#include "ICC_Timer_Handler.h"
#include "RedisClient.h"
#include "GameBase.h"
#include "DbPart.h"
#include "CClient.h"
#include "def.h"
#include "HostBase.h"

const unsigned int MOD_DENOMINATOR = 20;

class CHost;
class CGameServer : BYTimerOject
{
public:
	CGameServer();
	virtual ~CGameServer();
public:
	// callback && interface
	virtual bool InitGame();
	virtual int OnBYTimeOut(int Timerid);
	int ProcessPacket(SocketHandler* pHandler, NETInputPacket* inputPkg);
	int ProcEventPublishService(int ev_id, SpiderEvent* pEvent);
public:
	bool UpdateUserAllData(const unsigned int uid);
private:
	int ProcGameUserinfoUpdateSet();
	bool GetGameUserinfoUpuidSet(const std::string& setkey, std::vector<unsigned int>& vectuid);
	std::vector<std::string> m_upuidSetKeys;
	int m_keyIndex;
public:
	CHost* m_pHost;
	RedisClient* m_GameUserinfoRedis;
	CDbPart m_dbHandler;
};


#endif


